<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-05-12 10:04:39
         compiled from "C:\wamp\www\project.adm.uppii\admin\aplications\views\paginas\editar_pagina.tpl" */ ?>
<?php /*%%SmartyHeaderCode:318735530e9407258f6-62051806%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '0a9648eb25ec3550379511ea9aec63e82234a274' => 
    array (
      0 => 'C:\\wamp\\www\\project.adm.uppii\\admin\\aplications\\views\\paginas\\editar_pagina.tpl',
      1 => 1431435873,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '318735530e9407258f6-62051806',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.21-dev',
  'unifunc' => 'content_5530e940b9a409_40841785',
  'variables' => 
  array (
    'listar' => 0,
    'action' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5530e940b9a409_40841785')) {function content_5530e940b9a409_40841785($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_replace')) include 'C:\\wamp\\www\\project.adm.uppii\\admin\\aplications\\libs\\smarty\\libs\\plugins\\modifier.replace.php';
?><?php if ($_GET['action']=='newpage') {?>
    <?php $_smarty_tpl->tpl_vars['action'] = new Smarty_variable('cadastrar', null, 0);?>
<?php } else { ?>
    <?php if (count($_smarty_tpl->tpl_vars['listar']->value)<=0) {?>
        <?php echo '<script'; ?>
 type="text/javascript">window.location.href='<?php echo @constant('URLDOMINIOADMIN');?>
paginas';</SCRIPT>
    <?php }?>
    <?php $_smarty_tpl->tpl_vars['action'] = new Smarty_variable('atualizar', null, 0);?>
<?php }?>
<form method="post" action="<?php echo smarty_modifier_replace($_SERVER['REQUEST_URI'],$_GET['action'],$_smarty_tpl->tpl_vars['action']->value);?>
" id="form_page">
    
    <input type="hidden" name='id' id='id' value='<?php echo $_GET['id'];?>
' />
    
    <div class='row'>
        <div class='col-md-8 col-sm-8 b_margin_10x'>
            <section>
                <ul class='nav nav-tabs'>
                    <li class='active'><a href='#conteudo_box' data-toggle="tab">CONTEUDO</a></li>
                    <li><a href='#seo_box' data-toggle="tab">SEO</a></li>
                    <li><a href='#recursos_box' data-toggle="tab">RECURSOS</a></li>
                </ul>
                <div class="tab-content v_margin_15x">
                    <div id='conteudo_box' class="tab-pane active">
                        <div class='form-group'>
                            <label><h4>Titulo da pagina - <small>D&ecirc; um nome a esta pagina</small></h4></label>
                            <input class='form-control' type="text" name='nome' id='nome' value='<?php if ($_GET['action']=='edit') {
echo $_smarty_tpl->tpl_vars['listar']->value[0]['nome'];
}?>' />
                        </div>
                        <div class='form-group'>
                            <label><h4>Resenha da pagina - <small>Esta descrição da pagina que ira aparecer em destaque</small></h4></label>
                            <input class='form-control' type="text" name='resenha' id='resenha' value='<?php if ($_GET['action']=='edit') {
echo $_smarty_tpl->tpl_vars['listar']->value[0]['resenha'];
}?>' />
                        </div>
                        <div class='form-group'>
                            <div class='content-toolbar'>
                                <div class='btn-group'>
                                    <a class='btn btn-sm btn-default' href='javascript:;' title='Adicionar imagem'>
                                        <i class='el el-picture'></i>
                                        Adicionar imagem no sistema
                                    </a>
                                    <a class='btn btn-sm btn-default' href='<?php echo @constant('URLDOMINIOADMIN');?>
tabs' title='Separar conteudo em categoria'>
                                        <i class='el el-folder'></i>
                                        Criar Abas
                                    </a>
                                </div>
                            </div>
                            <textarea name='conteudo' id='conteudo_editor'><?php if ($_GET['action']=='edit') {
echo $_smarty_tpl->tpl_vars['listar']->value[0]['conteudo'];
}?></textarea>
                        </div>
                    </div><!--end #conteudo_box-->
                    <div id='seo_box' class="tab-pane">
                        <div class='form-group'>
                            <label><h4>Title - <small>Titulo que aparece na aba do navegador</small></h4></label>
                            <input class='form-control' type="text" name='title_seo' id='title_seo' value='<?php if ($_GET['action']=='edit') {
echo $_smarty_tpl->tpl_vars['listar']->value[0]['title_seo'];
}?>' />
                        </div>
                        <div class='form-group'>
                            <label><h4>keywords - <small>Palavras chaves relacionada ao conteudo</small></h4></label>
                            <input class='form-control' type="text" name='keywords_seo' id='keywords_seo' value='<?php if ($_GET['action']=='edit') {
echo $_smarty_tpl->tpl_vars['listar']->value[0]['keywords_seo'];
}?>' />
                        </div>
                        <div class='form-group'>
                            <label><h4>Description - <small>Descri&ccedil;&atilde;o que aparecera nos reseultado das pesquisa dos buscadores</small></h4></label>
                            <input class='form-control' type="text" name='description_seo' id='description_seo' maxlength="140" value='<?php if ($_GET['action']=='edit') {
echo $_smarty_tpl->tpl_vars['listar']->value[0]['description_seo'];
}?>'  />
                        </div>
                        <div class='form-group'>
                            <label><h4>Metas tags - <small>Coloque aqui outras metas tags que ajudara rankear suas paginas nos buscadores</small></h4></label>
                            <textarea name="metastag_seo" class="form-control" ><?php if ($_GET['action']=='edit') {
echo $_smarty_tpl->tpl_vars['listar']->value[0]['metastag_seo'];
}?></textarea>
                        </div>
                    </div><!--end #seo_box-->
                    <div id='recursos_box' class="tab-pane">
                        <div class="row">
                            <div class='col-md-6'>
                                <div class='form-group switch-group'>
                                    <label for='visivel'>
                                        <p><i class='ion ion-eye'></i> Pagina visivel</p>
                                    </label>
                                    <div class='switch-wrapper'><input 
                                        <?php if ($_GET['action']=='edit') {?>
                                            <?php if ($_smarty_tpl->tpl_vars['listar']->value[0]['visivel']>0) {?>checked='checked'<?php }?>
                                        <?php }?> 
                                        id='visivel' type="checkbox" name='visivel' class='on_off' />
                                    </div>
                                </div>
                                <div class='form-group switch-group'>
                                    <label for='destaque'><p><i class='ion ion-pin'></i> Destacar pagina</p></label>
                                    <div class='switch-wrapper'><input 
                                        <?php if ($_GET['action']=='edit') {?>
                                            <?php if ($_smarty_tpl->tpl_vars['listar']->value[0]['destaque']>0) {?>checked='checked'<?php }?> 
                                        <?php }?>
                                        id='destaque' type="checkbox" name='destaque' class='on_off' />
                                    </div>
                                </div>
                            </div>
                            <div class='col-md-6'>
                                <div class='form-group switch-group'>
                                    <label for="comentario"><p><i class='ion ion-android-chat'></i> Comentario</p></label>
                                    <div class='switch-wrapper'><input 
                                         <?php if ($_GET['action']=='edit') {?>
                                            <?php if ($_smarty_tpl->tpl_vars['listar']->value[0]['comentario']>0) {?>checked='checked'<?php }?> 
                                        <?php }?>
                                         id='comentario' type="checkbox" name='comentario' class='on_off' />
                                    </div>
                                </div>
                                <div class='form-group switch-group'>
                                    <label for='compartilhar'><p><i class='ion ion-thumbsup'></i> Botoes curtir</p></label>
                                    <div class='switch-wrapper'><input 
                                        <?php if ($_GET['action']=='edit') {?>
                                            <?php if ($_smarty_tpl->tpl_vars['listar']->value[0]['compartilhar']>0) {?>checked='checked'<?php }?> 
                                        <?php }?>
                                         id='compartilhar' type="checkbox" name='compartilhar' class='on_off' />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div><!--end #recursos_box-->
                </div>
            </section>
        </div>
        <div class='col-md-4 col-sm-4'>
            <section class='widget'>
                <div class="widget-content">
                    <ul class="list-unstyled">
                        <li>
                            <i class='fa fa-calendar'></i>
                            <span>Criada em:</span>
                        </li>
                        <li>
                            <i class='fa fa-clock-o'></i>
                            <span>Atualizada em:</span>
                        </li>
                        <li>
                            <i class='fa fa-trash-o'></i>
                            <a href='javascript:;' data-id='<?php echo $_smarty_tpl->tpl_vars['listar']->value[0]['id'];?>
' class='del_page' class='text-danger font-bold'>Excluir pagina</a>
                        </li>
                        <li>
                            <div class='switch-group publicPage'>
                                <i class='fa fa-power-off'></i>
                                <label>Ativar pagina</label>
                                <div class='switch-wrapper'>
                                    <input  <?php if ($_GET['action']=='edit') {?>
                                                <?php if ($_smarty_tpl->tpl_vars['listar']->value[0]['publicada']>0) {?>checked='checked'<?php }?> 
                                            <?php }?> 
                                            class='on_off' type="checkbox" name="publicada" id='publicada' />
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class='clearfix publicPage v_padding_5x'>
                                <button type="submit" class='btn btn-success' id="btn_save_page">
                                    <i class='fa fa-save'></i>
                                    <?php if ($_GET['id']=='') {?>
                                        <span>Salvar altera&ccedil;&atilde;o</span>
                                    <?php } else { ?>
                                        <span>Atualizar conteudo</span>
                                    <?php }?>
                                </button>
                                    <a onclick="ExitPageConfirmer();" href='<?php echo @constant('URLDOMINIOADMIN');?>
paginas' class='btn btn-default'>
                                    <i class='fa fa-times-circle'></i>
                                    <span>Cancelar</span>
                                </a>
                            </div>
                        </li>
                    </ul>
                </div>
            </section>
        </div>
    </div>
</form>

<?php echo '<script'; ?>
>
    CKEDITOR.replace('conteudo_editor');
    
    jQuery(function () {
        
        //submete o formulario
        jQuery("#form_page").ajaxForm({
            beforeSubmit:function(){
                boxMensageLoad('-','-',true);
            },
            beforeSerialize:function(){
                for(instance in CKEDITOR.instances){
                    CKEDITOR.instances[instance].updateElement();
                }
            },
            success:function(resp){
                var $_obj = jQuery.parseJSON(resp);
                if($_obj.status){
                    boxMensageLoad($_obj.msg,'fa fa-check',false);
                     if(jQuery('#id').val() == ''){
                         jQuery('#id').val($_obj.id_page);
                     }
                }else{
                    boxMensageLoad($_obj.msg,'fa fa-warning',false);
                }
            }
        });

        // Javascript to enable link to tab
        var url = document.location.toString();
        if (url.match('#')) {
            jQuery('.nav-tabs a[href=#' + url.split('#')[1] + ']').tab('show');
        }

        // Change hash for page-reload
        jQuery('.nav-tabs a').on('shown', function (e) {
            window.location.hash = e.target.hash;
        });
        
    })
<?php echo '</script'; ?>
><?php }} ?>
